package com.szzg10.pattern.singleton;

public class SingletonLazy {

	private static SingletonLazy singletonLazy;
	
	private SingletonLazy() {}
	
	public static SingletonLazy getInstance() {
		if(singletonLazy == null) {
			synchronized (SingletonLazy.class) {
				if(singletonLazy == null) {
					singletonLazy = new SingletonLazy();
				}
			}
		}
		
		return singletonLazy;
	}
	
	public void sayHello() {
		System.out.println("I am SingletonLazy!!!");
	}

}
